#ifndef _KC_WATCHDOG_H__KC_
#define _KC_WATCHDOG_H__KC_

#include <boost/thread.hpp>
#include <boost/noncopyable.hpp>
#include "Listener.h"
#include "OutputSender.h"
#include "Analyzer.h"
#include "../logs/Logger.h"
#include "SystemStatus.h"

namespace kc_sf
{
	class WatchDog : public boost::noncopyable
	{
		public:

			static WatchDog & getInstance( bool configuration_from_xml = false );
			~WatchDog();

			void stop();

		private:

			boost::thread_group wd_threads;
			Listener *wd_listener;
			Analyzer *wd_analyzer;
			OutputSender *wd_sender;
			SystemStatus *wd_system_status;
			Logger *wd_logger;

			void startListener();
			void startAnalyzer();
			void startOutputSender();
			void startSystemStatus();
			void startWWWService();

			// singleton
			explicit WatchDog( bool configuration_from_xml );
	};
}

#endif // _KC_WATCHDOG_H__KC_
